namespace FadeLang.CstVisitor
{
    public class LiteralsVisitor : FadeLangBaseVisitor<dynamic>
    {
        private static LiteralsVisitor instance;
        public static LiteralsVisitor Instance => instance ?? (instance = new LiteralsVisitor());

        public override dynamic VisitLiterals(FadeLangParser.LiteralsContext context) {
            if (context.@null() != null) {
                return null;
            }
            if (context.@true() != null) {
                return true;
            }
            if (context.@false() != null) {
                return false;
            }
            if (context.number() != null) {
                return NumberVisitor.Instance.VisitNumber(context.number());
            }
            if (context.@string() != null) {
                return StringVisitor.Instance.VisitString(context.@string());
            }
            return base.VisitLiterals(context);
        }
    }
}